package views
{
	import inerface.ISysRecommendPathInfoPanel;
	
	import main.ViewSubBase;
	
	import panel.recommendPathInfo.SysRecommendPathInfoPanel;
	
	import struct.RecommendPath;
	
	public class SysRecommendPathInfoView extends ViewSubBase
	{
		private var _panel:ISysRecommendPathInfoPanel;
		
		public var info:RecommendPath;
		
		public function SysRecommendPathInfoView()
		{
		}
		
		public override function show():void
		{
			render();
		}
		
		protected override function render():void
		{
			if(!_panel){
				_panel = new SysRecommendPathInfoPanel;
				
				_panel.showDetail = showDetail;
				
				_panel.init(view.layout.stage,view.resourceLoader,view.lang,view.uri);
			}
			
			_panel.changeData = info;
			this.addView(_panel);
		}
		
		public override function clear():void
		{
			if(_panel){
				_panel.clear();
				_panel = null;
			}
		}
		
		public override function close():void
		{
			view.layout.closeView(this);
		}
		
		private function showDetail(list:Array,str:String = ""):void
		{
			view.selectPath.pathList = list;
			view.selectPath.titleStr = str;
			view.selectPath.show();
		}
	}
}